package com.sgb.kjwl.view.ui.adapter.self.publish;

import android.content.Context;
import androidx.appcompat.widget.AppCompatCheckBox;

import android.widget.LinearLayout;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.link.entity.GoodsSkuChild;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class SpecCheckAdapter extends BaseRecycleAdapter<GoodsSkuChild> {

    public ItemChildCLickListener itemChildCLickListener;
    private AppCompatCheckBox check;

    public void setItemChildCLickListener(ItemChildCLickListener itemChildCLickListener) {
        this.itemChildCLickListener = itemChildCLickListener;
    }

    public SpecCheckAdapter(Context context, List<GoodsSkuChild> datas) {
        super(context, R.layout.item_spec_check, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, GoodsSkuChild data) {
        holder.setBinding(BR.viewModel, data);
        check = holder.getItem().findViewById(R.id.check);
        check.setText(data.getVal());
    }

    @Override
    public void onBindViewHolder(ItemViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);
    }

    public interface ItemChildCLickListener {
        void deleteOne(int position);

        void selectCity(LinearLayout root, int position);
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}
